//
//  MineCertificationViewController.m
//  YongChuanTradingArea
//
//  Created by Vivian on 2017/9/20.
//  Copyright © 2017年 李冰. All rights reserved.
//

#import "MineCertificationViewController.h"

@interface MineCertificationViewController ()
@property (weak, nonatomic) IBOutlet UIImageView *cardLfImgView;
@property (weak, nonatomic) IBOutlet UIImageView *cardRtImgView;
@property (weak, nonatomic) IBOutlet UIImageView *cardHandImgView;
@property (weak, nonatomic) IBOutlet UIImageView *certifImgView;
@property (weak, nonatomic) IBOutlet UIImageView *otherOneImgView;
@property (weak, nonatomic) IBOutlet UIImageView *otherTwoImgView;
@property (weak, nonatomic) IBOutlet UIImageView *otherThreeImgView;
@property (weak, nonatomic) IBOutlet UIImageView *otherForthImgView;

@end

@implementation MineCertificationViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"资质管理";
    [self createUI];
    // Do any additional setup after loading the view from its nib.
}

- (void)createUI{
    UserModel * model = [LBUserManage defaultManager].userModel;
    int j = 0;
    int k = 0;
    for (int i = 0; i < model.ImgList.count; i ++) {
        UserModelImgList * img = model.ImgList[i];
        if ([img.imgtype isEqualToString:@"GRHHRSFZ"]) {
            if (j == 0) {
                [self.cardLfImgView sd_setImageWithURL:[NSURL URLWithString:img.image] placeholderImage:PLACE_HOLDER];
            }else{
                [self.cardRtImgView sd_setImageWithURL:[NSURL URLWithString:img.image] placeholderImage:PLACE_HOLDER];
            }
            j++;
        }
        if ([img.imgtype isEqualToString:@"GRHHRSCSFZ"]) {
            [self.cardHandImgView sd_setImageWithURL:[NSURL URLWithString:img.image] placeholderImage:PLACE_HOLDER];
        }
        if ([img.imgtype isEqualToString:@"HYDYYZZZP"]||[img.imgtype isEqualToString:@"QYYYZZZP"]) {
            [self.cardHandImgView sd_setImageWithURL:[NSURL URLWithString:img.image] placeholderImage:PLACE_HOLDER];
        }
        if ([img.imgtype isEqualToString:@"HYDQTZZZP"]||[img.imgtype isEqualToString:@"QYQTZZZP"]) {
            if (k == 0) {
                [self.otherOneImgView sd_setImageWithURL:[NSURL URLWithString:img.image] placeholderImage:PLACE_HOLDER];
            }
            if (k == 1) {
                [self.otherTwoImgView sd_setImageWithURL:[NSURL URLWithString:img.image] placeholderImage:PLACE_HOLDER];
            }
            if (k == 2) {
                [self.otherThreeImgView sd_setImageWithURL:[NSURL URLWithString:img.image] placeholderImage:PLACE_HOLDER];
            }
            if (k == 3) {
                [self.otherForthImgView sd_setImageWithURL:[NSURL URLWithString:img.image] placeholderImage:PLACE_HOLDER];
            }
            k++;
        }
    }
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
